<?php defined('InShopNC') or exit('Access Invalid!');?>
<div class="ncm-container">
    <?php include template('member/member_left');?>
    <div class="right-layout">
        <div id="member_center_box" class="ncm-index-container">
            <div id="account" class="double">
                <div class="outline">
                    <div class="user-account">
                        <ul>
                            <li id="pre-deposit"><a href="index.php?act=predeposit&op=pd_log_list" title="查看我的余额">
                                    <h5>账户余额</h5>
                                    <span class="icon"></span> <span class="value">￥<em><?php echo $output['member_info']['available_predeposit'];?></em></span></a>
                            </li>
                            <?php if (intval(C('voucher_allow')) == 1){?>
                                <li id="voucher"><a href="index.php?act=member_voucher&op=index" title="查看我的代金券">
                                        <h5>代金券</h5>
                                        <span class="icon"></span> <span class="value"><em><?php echo $output['member_info']['voucher'];?></em>张</span></a>
                                </li>
                            <?php } ?>
                            <?php if (intval(C('points_isuse')) == 1){?>
                                <li id="points"><a href="index.php?act=member_points&op=index" title="查看我的积分">
                                        <h5>可用积分</h5>
                                        <span class="icon"></span> <span class="value"><em><?php echo $output['member_info']['member_points'];?></em>分</span></a>
                                </li>
                            <?php } ?>
                        </ul>
                    </div>
                </div>
            </div>
            <div id="security" class="normal">
                <div class="outline">
                    <div class="SAM">
                        <h5><a href="index.php?act=member_security&op=index" title="查看我的账户安全">账户安全</h5>
                        <?php if ($output['member_info']['member_email_bind']==1 && $output['member_info']['member_mobile_bind']==1 && !empty($output['member_info']['member_paypwd'])){ ?>
                            <div id="high" class="SAM-info"><strong>高</strong><span><em></em></span>
                            </div>
                        <?php } elseif ($output['member_info']['member_email_bind']==1 || $output['member_info']['member_mobile_bind']==1){ ?>
                            <div id="normal" class="SAM-info"><strong>中</strong><span><em></em></span>
                                <a href="<?php echo urlShop('member_security','index');?>" title="安全设置">提升></a>
                            </div>
                        <?php } else { ?>
                            <div id="low" class="SAM-info"><strong>低</strong><span><em></em></span>
                                <a href="<?php echo urlShop('member_security','index');?>" title="安全设置">提升></a>
                            </div>
                        <?php } ?>
                        <div class="SAM-handle"><span><i class="mobile"></i>手机：
                                <?php if ($output['member_info']['member_mobile_bind']==1){?><em>已绑定</em><?php  }else{ ?><a href="<?php echo urlShop('member_security','index');?>" title="绑定手机">未绑定</a><?php  } ?>
        </span>
        <span><i class="mail"></i>邮箱：
            <?php if ($output['member_info']['member_email_bind']==1){?><em>已绑定</em><?php  }else{ ?><a href="<?php echo urlShop('member_security','auth');?>&type=modify_email" title="绑定邮箱">未绑定</a><?php  } ?>
        </span>
                        </div>
                    </div>
                </div>
            </div>
            <div id="transaction" class="double">
                <div class="outline">
                    <div class="title">
                        <h3>交易提醒</h3>
                        <ul>
                            <li><a href="index.php?act=member_order&state_type=state_new">待付款<em><?php echo $output['member_info']['order_nopay'];?></em></a></li>
                            <li><a href="index.php?act=member_order&state_type=state_send">待收货<em><?php echo $output['member_info']['order_noreceiving'];?></em></a></li>
                            <li><a href="index.php?act=member_order&state_type=state_noeval">待评价<em><?php echo $output['member_info']['order_noeval'];?></em></a></li>
                        </ul>
                    </div>


                    <div class="order-list">
                        <ul>
                            <?php if ($output['order_group_list']) { ?>
                                <?php foreach ($output['order_group_list'] as $order_pay_sn => $group_info) { ?><?php $p = 0;?>
                                    <?php foreach($group_info['order_list'] as $order_id => $order_info) {?>
                                        <?php if ($order_info['order_state']>=10 && $order_info['evaluation_state'] == 0 && TIMESTAMP - $order_info['add_time'] <= 86400*30) { ?>
                                            <?php foreach ((array)$order_info['extend_order_goods'] as $k => $goods_info) {?>
                                                <?php if ((count($order_info['extend_order_goods']) > 1 && $k ==0) || (count($order_info['extend_order_goods']) == 1)){?>
                                                    <li>
                                                        <div class="ncm-goods-thumb"><a target="_blank" href="index.php?act=member_order&op=show_order&order_id=<?php echo $order_info['order_id']; ?>"><img src="<?php echo thumb($goods_info,60);?>" /></a><?php if (count($order_info['extend_order_goods']) > 1) {?><em><?php echo count($order_info['extend_order_goods']);?></em><?php } ?></div>
                                                        <dl class="ncm-goods-info">
                                                            <dt><a href="index.php?act=member_order&op=show_order&order_id=<?php echo $order_info['order_id']; ?>" target="_blank"><?php echo $goods_info['goods_name']; ?></a>
                                                                <?php if (count($order_info['extend_order_goods']) > 1) {?><span>等<strong><?php echo count($order_info['extend_order_goods']);?></strong>件商品</span><?php } ?>
                                                            </dt>
                                                            <dd><span class="order-date">下单时间：<?php echo date("Y-m-d H:i:s",$order_info['add_time']); ?></span><span class="ncm-order-price">订单金额：<em>￥<?php echo $order_info['order_amount']; ?></em></span></dd>
                                                            <dd><span class="order-state">订单状态：<?php echo $order_info['state_desc']; ?><?php echo $order_info['evaluation_status'] ? $lang['member_order_evaluated'].'<br/>' : '';?>
                                                                    <?php if ($order_info['if_deliver'] && $order_info['order_state'] == 30){ ?>
                                                                        <a href='index.php?act=member_order&op=search_deliver&order_id=<?php echo $order_info['order_id']; ?>&order_sn=<?php echo $order_info['order_sn']; ?>' target="_blank"><i class="icon-truck"></i>查看物流</a>
                                                                    <?php } ?></span>
                                                            </dd>
                                                        </dl>
                                                        <?php if (!empty($group_info['pay_amount']) && $p == 0) {?>
                                                            <a href="index.php?act=buy&op=pay&pay_sn=<?php echo $order_pay_sn; ?>" target="_blank" class="ncm-btn">订单支付</a>
                                                        <?php } elseif ($order_info['if_evaluation']) { ?>
                                                            <a href="index.php?act=member_evaluate&op=add&order_id=<?php echo $order_info['order_id']; ?>" target="_blank" class="ncm-btn">交易评价</a>
                                                        <?php }else{ ?>
                                                            <a href="index.php?act=member_order&op=show_order&order_id=<?php echo $order_info['order_id']; ?>" target="_blank" class="ncm-btn">查看订单</a>
                                                        <?php }?>
                                                        <?php $p++;?>
                                                    </li>
                                                <?php } ?><?php } ?>
                                        <?php } ?>
                                    <?php }} ?>
                            <?php } else { ?>
                                <dl class="null-tip">
                                    <dt></dt>
                                    <dd>
                                        <h4>你买的东西太少了，这里空空的，快去挑选合适的商品吧！</h4>
                                    </dd>
                                </dl>
                            <?php } ?>
                        </ul>
                    </div>
                </div>
                <?php if($_SESSION['member_level']>2) {?>
                <div class="outline">
                    <div class="title" style="border-bottom: 1px #999999 solid;padding-bottom: 3px;">
                        <h3>找茶信息</h3><span class="more-findTea"><a href="/findtea/<?php echo url('article','article_list');?>">更多...</a></span>
                    </div>
                    <div class="findTea-list">
                        <ul>
                            <?php if ($output['findTea_list']) { ?>
                                <?php foreach ($output['findTea_list'] as $findTea) { ?>
                                    <li>
                                        <dl>
                                            <dt><span class="span-b"></span><a href="/findtea/index.php?act=article&op=article_detail&article_id=<?php echo $findTea['article_id']; ?>" target="_blank"><?php echo $findTea['article_title']; ?></a>
                                                <span style="float: right;"><?php echo date('Y-m-d',$findTea['article_publish_time'])?></span><span style="float: right; width: 60px;">回复<a href="/findtea/index.php?act=article&op=article_detail&article_id=<?php echo $findTea['article_id']; ?>" target="_blank">(<?php echo $findTea['article_comment_count'];?>)</a></span></dt>

                                        </dl>
                                    </li>
                                <?php } ?>
                            <?php } else { ?>
                                <dl class="null-tip">
                                    <dt></dt>
                                    <dd>
                                        <h4>还没有找茶信息！</h4>
                                    </dd>
                                </dl>
                            <?php } ?>
                        </ul>
                    </div>
                </div>
                <?php }?>
            </div>

            <div id="shopping" class="normal">
                <?php if($_SESSION['member_level']>2) {?>
                <div class="" style="min-height: 230px; height: 230px; overflow:hidden;">
                    <div class="title" style="border-bottom: 1px #999999 solid;padding-bottom: 3px;">
                        <h3>官方公告</h3>
                    </div>
                    <div class="notice-list" id="quotation">
                        <ul>
                            <?php if ($output['notice_list']) { ?>
                                <?php foreach ($output['notice_list'] as $notice) { ?>
                                    <li>
                                        <dl>
                                            <dt><span class="span-b"></span><a href="<?php echo url('article','article_detail',array('article_id'=>$notice['article_id']));?>" target="_blank"><?php echo mb_substr($notice['article_title'],0,18,'utf-8'); ?></a></dt>

                                        </dl>
                                    </li>
                                <?php } ?>
                            <?php } else { ?>
                                <dl class="null-tip">
                                    <dt></dt>
                                    <dd>
                                        <h4>还没有公告信息！</h4>
                                    </dd>
                                </dl>
                            <?php } ?>
                        </ul>
                    </div>
                </div>
                    <script type="text/javascript">
                        $(function(){
                            var scrtime;
                            if($('#quotation ul li').length>5)
                            {

                            $("#quotation").hover(function(){
                                clearInterval(scrtime);

                            },function(){

                                scrtime = setInterval(function(){
                                    var $ul = $("#quotation ul");
                                    var liHeight = $ul.find("li:last").height();
                                    $ul.animate({marginTop : liHeight + 30 + "px"},1000,function(){
                                        $ul.find("li:last").prependTo($ul)
                                        $ul.find("li:first").hide();
                                        $ul.css({marginTop:0});
                                        $ul.find("li:first").fadeIn(1000);
                                    });
                                },2000);

                            }).trigger("mouseleave");

                            }
                        });
                    </script>

                <?php }?>
                <div class="" style="min-height: 230px;">
                    <div class="title" style="border-bottom: 1px #999999 solid;padding-bottom: 3px;">
                        <h3>官方动态</h3><span class="more-findTea"><a href="<?php echo url('article','article',array('ac_id'=>13));?>">更多...</a></span>
                    </div>
                    <div class="notice-list">
                        <ul>
                            <?php if ($output['news_list']) { ?>
                                <?php foreach ($output['news_list'] as $news) { ?>
                                    <li>
                                        <dl>
                                            <dt><span class="span-b"></span><a href="<?php echo url('article','article_detail',array('article_id'=>$news['article_id']));?>" target="_blank"><?php echo mb_substr($news['article_title'],0,18,'utf-8'); ?></a></dt>

                                        </dl>
                                    </li>
                                <?php } ?>
                            <?php } else { ?>
                                <dl class="null-tip">
                                    <dt></dt>
                                    <dd>
                                        <h4>还没有动态信息！</h4>
                                    </dd>
                                </dl>
                            <?php } ?>
                        </ul>
                    </div>
                </div>
                <?php if($_SESSION['member_level']>2) {?>
                <div class="" style="min-height: 230px;">
                    <div class="title" style="border-bottom: 1px #999999 solid;padding-bottom: 3px;">
                        <h3>会员活动</h3><span class="more-findTea"><a href="<?php echo url('article','article',array('ac_id'=>20));?>">更多...</a></span>
                    </div>
                    <div class="notice-list">
                        <ul>
                            <?php if ($output['actives_list']) { ?>
                                <?php foreach ($output['actives_list'] as $actives) { ?>
                                    <li>
                                        <dl>
                                            <dt><span class="span-b"></span><a href="<?php echo url('article','article_detail',array('article_id'=>$actives['article_id']));?>" target="_blank"><?php echo mb_substr($actives['article_title'],0,18,'utf-8'); ?></a></dt>

                                        </dl>
                                    </li>
                                <?php } ?>
                            <?php } else { ?>
                                <dl class="null-tip">
                                    <dt></dt>
                                    <dd>
                                        <h4>还没有公告信息！</h4>
                                    </dd>
                                </dl>
                            <?php } ?>
                        </ul>
                    </div>
                </div>
                <?php }?>
            </div>

            <script type="text/javascript">
                $(function(){
                    //信息轮换
                    $.getScript("<?php echo RESOURCE_SITE_URL;?>/js/jcarousel/jquery.jcarousel.min.js", function(){
                        $('#favoritesGoodsList').jcarousel({visible: 4,itemFallbackDimension: 300});
                        $('#favoritesStoreList').jcarousel({visible: 3,itemFallbackDimension: 300});
                        $('#friendsShareList').jcarousel({visible: 3,itemFallbackDimension: 300});
                        $('#circleList').jcarousel({visible: 3,itemFallbackDimension: 300});
                        $('#browseMarkList').jcarousel({visible: 3,itemFallbackDimension: 300});
                    });
                });
            </script>
        </div>

    </div>
    <div class="clear"></div>
</div>